using DA.AnimGraph;
using UnityEngine.UIElements;


namespace DA.AnimGraph.Editor {

    internal class InspectorField_Int : InspectorField<RefField<int>> {

        IntegerField intField;

        protected override void BuildUI() {
            intField = new IntegerField(labelText);
            intField.value = source.value;
            intField.RegisterCallback<FocusOutEvent>(OnChange);
        }

        private void OnChange(FocusOutEvent evt) {
            source.value = intField.value;
            inspectorChangeCallback?.Invoke();
        }

        protected override void DrawUI() {
            Add(intField);
        }

    }

}
